<%@ control language="C#" autoeventwireup="true" codebehind="ModalFrame.ascx.cs" inherits="Cyberwolf.Modules.PWCAPAdmin.UserControls.ModalFrame" %>
<%@ register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:linkbutton id="lnkPop" runat="server" style="display: none;"></asp:linkbutton>
<asp:panel id="panFrame" cssclass="form" runat="server" style="display: none;">
    <div class="modrsh">
        <div class="modbsh">
            <div class="cont shadow">
                <h1><img alt="x" onclick='<%= OpenFunction+"Close();" %>' src='<%= ResolveUrl("../images/close.png") %>' class="btn" /><span id="modhead"><%= WindowTitle %></span></h1>
                <iframe frameborder="0"></iframe>
            </div>
        </div>
    </div>
</asp:panel>
<asp:modalpopupextender id="mpeMain" runat="server" backgroundcssclass="modalbg" repositionmode="RepositionOnWindowResizeAndScroll" popupcontrolid="panFrame" targetcontrolid="lnkPop"></asp:modalpopupextender>

<script type="text/javascript">
var <%= OpenFunction %> = function(link, heading)
{
    if (heading)
    {
        jQuery('#modhead').text(heading);
    }
    else
    {
        jQuery('#modhead').html('&nbsp;');
    }
    var ifr = jQuery('div#<%= panFrame.ClientID %> iframe').get(0);
    ifr.src = link? link : '<%= Link %>';
    ifr.width = <%= Width %>;
    ifr.height = <%= Height %>;
    $find('<%= mpeMain.ClientID %>').show(); // This method is from ASP.NET Ajax
};
var <%= OpenFunction %>Close = function(refresh)
{
    jQuery('div#<%= panFrame.ClientID %> iframe').get(0).src='';
    $find('<%= mpeMain.ClientID %>').hide(); // This method is from ASP.NET Ajax
    if (refresh) window.location.replace( window.location.href );
};
</script>

